package schema

import (
	"entgo.io/ent"
	"entgo.io/ent/dialect/entsql"
	"entgo.io/ent/schema"
	"entgo.io/ent/schema/field"

	cent "gitee.com/shuokeyun/common/ent"
)

type MerchantUser struct {
	ent.Schema
}

func (MerchantUser) Mixin() []ent.Mixin {
	return []ent.Mixin{
		cent.OrmMixin{},
	}
}

func (MerchantUser) Annotations() []schema.Annotation {
	return []schema.Annotation{
		entsql.Annotation{
			Table: "sk_merchant_user",
		},
	}
}

func (MerchantUser) Fields() []ent.Field {
	return []ent.Field{
		field.Int32("merchant_id").Immutable().Comment("商户id"),
		field.String("mobile").Comment("手机号"),
		field.String("username").Comment("用户名"),
		field.String("real_name").Comment("实名"),
		field.String("password").Comment("密码"),
		field.String("salt").Comment("加密盐"),
		field.Int8("status").Comment("状态 1正常;2禁用"),
		field.String("detail").Comment("个人说明"),
		field.String("head_image").Comment("头像"),
		field.Int8("role").Comment("1老板;2医生;3护士"),
	}
}
